package com.bw.liuyushan.zhuangao4_weektest2.Adapter;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentStatePagerAdapter;

import java.util.ArrayList;

/**
 * ZhuanGao4_WeekTest2
 * file name is : FragmentTableAdapter
 * created by Ender on 2021/8/23 9:18.
 * author : 刘雨杉
 * Describe(作用):
 */
public class FragmentUserAdapter extends FragmentStatePagerAdapter {
    ArrayList<Fragment> userlist;
    ArrayList<String> struser;

    public FragmentUserAdapter(@NonNull FragmentManager fm, ArrayList<Fragment> userlist, ArrayList<String> struser) {
        super(fm);
        this.userlist = userlist;
        this.struser = struser;
    }

    @Override
    public Fragment getItem(int position) {
        return userlist.get(position);
    }

    @Override
    public int getCount() {
        return userlist.size();
    }

    @Nullable
    @Override
    public CharSequence getPageTitle(int position) {
        return struser.get(position);
    }
}
